//
//  RFAOutlineView
//  RFA Manager
//
//  Created by Torsten Kammer on 29.03.08.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#import "RFAOutlineView.h"
#import "RFADragAndDropDelegate.h"
#import "MyDocument.h"

@implementation RFATableView

- (void)draggedImage:(NSImage *)image endedAt:(NSPoint)screenPoint operation:(NSDragOperation)operation
{
	if (operation == NSDragOperationDelete)
	{
		[[self dataSource] deleteDraggedNodes];
	}
	else
	{
		[[self dataSource] clearDraggedNodes];
		[super draggedImage:image endedAt:screenPoint operation:operation];
	}
    [[[self delegate] document] updateSearchPredicate];
}

@end

@implementation RFAOutlineView

- (void)draggedImage:(NSImage *)image endedAt:(NSPoint)screenPoint operation:(NSDragOperation)operation
{
	if (operation == NSDragOperationDelete)
	{
		[[self dataSource] deleteDraggedNodes];
	}
	else
	{
		[[self dataSource] clearDraggedNodes];
		[super draggedImage:image endedAt:screenPoint operation:operation];
	}
}

@end

@implementation RFABrowser

- (void)draggedImage:(NSImage *)image endedAt:(NSPoint)screenPoint operation:(NSDragOperation)operation
{
	if (operation == NSDragOperationDelete)
	{
		[[self delegate] deleteDraggedNodes];
	}
	else
	{
		[[self delegate] clearDraggedNodes];
		[super draggedImage:image endedAt:screenPoint operation:operation];
	}
}

@end

@implementation RFAPathControl

- (void)draggedImage:(NSImage *)image endedAt:(NSPoint)screenPoint operation:(NSDragOperation)operation
{
	if (operation == NSDragOperationDelete)
	{
		[[self delegate] deleteDraggedNodes];
	}
	else
	{
		[[self delegate] clearDraggedNodes];
		[super draggedImage:image endedAt:screenPoint operation:operation];
	}
    [[[self delegate] document] updateSearchPredicate];
}

- (NSArray *)namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination;
{
	return [[self delegate] namesOfPromisedFilesDroppedAtDestination:dropDestination];
}

@end